#ifndef IRemote_H
#define IRemote_H

#define NORMCUSTOM 0xAA
#define TESTCUSTOM 0xB5
#define JUMPCUSTOM 0xCC

#define IREMOTEMAX 17
#define IREMOTEMAX_MB 12

#ifdef IRemote_Variable
#define IRemote_Extern




static struct
{
    U8 stat; // 遥控接收状态

    U8 bit;      // 遥控接收bit计数
    U8 byte;     // 遥控接收byte计数
    U8 interval; // 遥控接收间隔计数
} ir_Rec;



static ram_byte irCheckFlag;
#define irCheck irCheckFlag.byte // 遥控接收校验结果
#define f_irCheck0 irCheckFlag.bit.b0
#define f_irCheck1 irCheckFlag.bit.b1
#define f_irCheck2 irCheckFlag.bit.b2
#define f_irCheck3 irCheckFlag.bit.b3

 ram_byte buff_IR_MB[IREMOTEMAX_MB]; // 遥控接收缓存
//static ram_byte buff_IR_MB[IREMOTEMAX_MB]; // 遥控接收缓存

 ram_byte buff_IR[IREMOTEMAX]; // 遥控接收缓存
//static ram_byte buff_IR[IREMOTEMAX]; // 遥控接收缓存
#define IR_Custom buff_IR[0].byte
#define IR_Code01 buff_IR[1].byte
#define IR_Data01 buff_IR[2].byte
#define IR_Data01_b0 buff_IR[2].bit.b0
#define IR_Data01_b1 buff_IR[2].bit.b1
#define IR_Data01_b2 buff_IR[2].bit.b2
#define IR_Data01_b3 buff_IR[2].bit.b3
#define IR_Data01_b4 buff_IR[2].bit.b4
#define IR_Data01_b5 buff_IR[2].bit.b5
#define IR_Data01_b6 buff_IR[2].bit.b6
#define IR_Data01_b7 buff_IR[2].bit.b7
#define IR_Data02 buff_IR[3].byte
#define IR_Data02_b0 buff_IR[3].bit.b0
#define IR_Data02_b1 buff_IR[3].bit.b1
#define IR_Data02_b2 buff_IR[3].bit.b2
#define IR_Data02_b3 buff_IR[3].bit.b3
#define IR_Data02_b4 buff_IR[3].bit.b4
#define IR_Data02_b5 buff_IR[3].bit.b5
#define IR_Data02_b6 buff_IR[3].bit.b6
#define IR_Data02_b7 buff_IR[3].bit.b7
#define IR_Data03 buff_IR[4].byte
#define IR_Data03_b0 buff_IR[4].bit.b0
#define IR_Data03_b1 buff_IR[4].bit.b1
#define IR_Data03_b2 buff_IR[4].bit.b2
#define IR_Data03_b3 buff_IR[4].bit.b3
#define IR_Data03_b4 buff_IR[4].bit.b4
#define IR_Data03_b5 buff_IR[4].bit.b5
#define IR_Data03_b6 buff_IR[4].bit.b6
#define IR_Data03_b7 buff_IR[4].bit.b7
#define IR_Data04 buff_IR[5].byte
#define IR_Data04_b0 buff_IR[5].bit.b0
#define IR_Data04_b1 buff_IR[5].bit.b1
#define IR_Data04_b2 buff_IR[5].bit.b2
#define IR_Data04_b3 buff_IR[5].bit.b3
#define IR_Data04_b4 buff_IR[5].bit.b4
#define IR_Data04_b5 buff_IR[5].bit.b5
#define IR_Data04_b6 buff_IR[5].bit.b6
#define IR_Data04_b7 buff_IR[5].bit.b7
#define IR_Data05 buff_IR[6].byte
#define IR_Data05_b0 buff_IR[6].bit.b0
#define IR_Data05_b1 buff_IR[6].bit.b1
#define IR_Data05_b2 buff_IR[6].bit.b2
#define IR_Data05_b3 buff_IR[6].bit.b3
#define IR_Data05_b4 buff_IR[6].bit.b4
#define IR_Data05_b5 buff_IR[6].bit.b5
#define IR_Data05_b6 buff_IR[6].bit.b6
#define IR_Data05_b7 buff_IR[6].bit.b7
#define IR_Data06 buff_IR[7].byte
#define IR_Data06_b0 buff_IR[7].bit.b0
#define IR_Data06_b1 buff_IR[7].bit.b1
#define IR_Data06_b2 buff_IR[7].bit.b2
#define IR_Data06_b3 buff_IR[7].bit.b3
#define IR_Data06_b4 buff_IR[7].bit.b4
#define IR_Data06_b5 buff_IR[7].bit.b5
#define IR_Data06_b6 buff_IR[7].bit.b6
#define IR_Data06_b7 buff_IR[7].bit.b7
#define IR_Check1 buff_IR[8].byte

#define IR_Code02 buff_IR[9].byte
#define IR_Data07 buff_IR[10].byte
#define IR_Data07_b0 buff_IR[10].bit.b0
#define IR_Data07_b1 buff_IR[10].bit.b1
#define IR_Data07_b2 buff_IR[10].bit.b2
#define IR_Data07_b3 buff_IR[10].bit.b3
#define IR_Data07_b4 buff_IR[10].bit.b4
#define IR_Data07_b5 buff_IR[10].bit.b5
#define IR_Data07_b6 buff_IR[10].bit.b6
#define IR_Data07_b7 buff_IR[10].bit.b7
#define IR_Data08 buff_IR[11].byte
#define IR_Data08_b0 buff_IR[11].bit.b0
#define IR_Data08_b1 buff_IR[11].bit.b1
#define IR_Data08_b2 buff_IR[11].bit.b2
#define IR_Data08_b3 buff_IR[11].bit.b3
#define IR_Data08_b4 buff_IR[11].bit.b4
#define IR_Data08_b5 buff_IR[11].bit.b5
#define IR_Data08_b6 buff_IR[11].bit.b6
#define IR_Data08_b7 buff_IR[11].bit.b7
#define IR_Data09 buff_IR[12].byte
#define IR_Data09_b0 buff_IR[12].bit.b0
#define IR_Data09_b1 buff_IR[12].bit.b1
#define IR_Data09_b2 buff_IR[12].bit.b2
#define IR_Data09_b3 buff_IR[12].bit.b3
#define IR_Data09_b4 buff_IR[12].bit.b4
#define IR_Data09_b5 buff_IR[12].bit.b5
#define IR_Data09_b6 buff_IR[12].bit.b6
#define IR_Data09_b7 buff_IR[12].bit.b7
#define IR_Data10 buff_IR[13].byte
#define IR_Data10_b0 buff_IR[13].bit.b0
#define IR_Data10_b1 buff_IR[13].bit.b1
#define IR_Data10_b2 buff_IR[13].bit.b2
#define IR_Data10_b3 buff_IR[13].bit.b3
#define IR_Data10_b4 buff_IR[13].bit.b4
#define IR_Data10_b5 buff_IR[13].bit.b5
#define IR_Data10_b6 buff_IR[13].bit.b6
#define IR_Data10_b7 buff_IR[13].bit.b7
#define IR_Data11 buff_IR[14].byte
#define IR_Data11_b0 buff_IR[14].bit.b0
#define IR_Data11_b1 buff_IR[14].bit.b1
#define IR_Data11_b2 buff_IR[14].bit.b2
#define IR_Data11_b3 buff_IR[14].bit.b3
#define IR_Data11_b4 buff_IR[14].bit.b4
#define IR_Data11_b5 buff_IR[14].bit.b5
#define IR_Data11_b6 buff_IR[14].bit.b6
#define IR_Data11_b7 buff_IR[14].bit.b7
#define IR_Data12 buff_IR[15].byte
#define IR_Data12_b0 buff_IR[15].bit.b0
#define IR_Data12_b1 buff_IR[15].bit.b1
#define IR_Data12_b2 buff_IR[15].bit.b2
#define IR_Data12_b3 buff_IR[15].bit.b3
#define IR_Data12_b4 buff_IR[15].bit.b4
#define IR_Data12_b5 buff_IR[15].bit.b5
#define IR_Data12_b6 buff_IR[15].bit.b6
#define IR_Data12_b7 buff_IR[15].bit.b7
#define IR_Check2 buff_IR[16].byte

#else
#define IRemote_Extern extern
#endif

IRemote_Extern ram_byte SetRunFlag3;
#define f_SetCapTest SetRunFlag3.bit.b1       /* 能力测试标志 */
#define f_SetNoCheckFo SetRunFlag3.bit.b2     /* 缺氟保护屏蔽标志 */
#define f_SetNoCheckDewing SetRunFlag3.bit.b3 /* 缺氟保护屏蔽标志 */
#define f_SetKeepHum SetRunFlag3.bit.b4       /* 保湿制冷标志 */


extern void PerformanceTestHorizontalAngleAdd(void);
extern void PerformanceTestHorizontalAngleSub(void);
extern void PerformanceTestInit(void);  //能力测试初始化
extern void PerformanceTestInit_2( void ); // 每次 切换模式 时候 赋初值

extern void PerformanceTest_Sub_FanSpeed(void);
extern void PerformanceTest_Add_FanSpeed(void);
extern PerformanceTestType  PerformanceTest;
extern void PerformanceTestDelay(void);

void IRemote_Intp(void);
void IRemote_Init(void);
U16 IRemote_Time(void);
void IRemoteCheck(void);
void IRemoteDecode(void);
#endif
